<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="./mvvm.js"></script>
  <div id="app">
    <div>
      <input type="text" v-model="name" placeholder="名字">
      <input type="text" v-model="age" placeholder="年龄">
      <input type="text" v-model="tel" placeholder="电话">
      <input oninput="admin(event)" @input="buttonClick" type="text" v-model="weight" placeholder="体重">
    </div>
    <div>
      <span>{{ name }}</span>
      <span>{{ age }}</span>
      <span>{{ tel }}</span>
      <span>{{ weight }}</span>
    </div>
    <button id="btn" @click="buttonClick">改变</button>


    <button id="btn" @adsdsad="test">test</button>

  </div>
  <script>

    const app = new MVVM({
      el:'#app',
      data:{
      name: '1',
      age: '5',
      tel: '7',
      weight: '6'
    },
    methods:{
      buttonClick(e){
        console.log('被地点击了');
        console.log(e)
        this.setData('name', '优秀')
      },
      test(e){
        console.log('122');
        console.log(e)
      }
    }
    });
    // document.querySelector('#btn').addEventListener('click', function () {
    //   // console.log(app);
    //   app.setData('name', '优秀')
    // })
    console.log();
    function admin(e){
      console.log(e)
    }
  </script>
</body>

</html>